package com.liuqi.voicenotes.data.db

import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
import com.liuqi.voicenotes.data.Priority

@Entity(
    tableName = "tasks",
    indices = [
        Index(value = ["dueAtMillis"], name = "index_tasks_dueAtMillis"),
        Index(value = ["priority", "completed"], name = "index_tasks_priority_completed")
    ]
)
data class TaskEntity(
    @PrimaryKey(autoGenerate = true) val id: Long = 0,
    val title: String,
    val dueAtMillis: Long?,
    val priority: Priority,
    val completed: Boolean = false
)